package com.xugui.thumb.services;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xugui.thumb.pojo.dto.DoThumbRequest;
import com.xugui.thumb.pojo.entity.Thumb;
import jakarta.servlet.http.HttpServletRequest;

public interface ThumbService extends IService<Thumb> {
    /**
     * 点赞
     * @param doThumbRequest 点赞请求
     * @param request 请求
     * @return 点赞结果
     */
    Boolean doThumb(DoThumbRequest doThumbRequest, HttpServletRequest request);

    /**
     * 取消点赞
     * @param doThumbRequest 点赞请求
     * @param request 请求
     * @return 取消点赞结果
     */
    Boolean undoThumb(DoThumbRequest doThumbRequest, HttpServletRequest request);

    /**
     * 判断用户是否点赞
     * @param blogId 博客 id
     * @param userId 用户 id
     * @return 是否点赞
     */
    Boolean hasThumb(Long blogId, Long userId);
}
